package dao;


import java.math.BigDecimal;
import java.sql.Connection;
import java.util.ArrayList;
import java.util.Date;
import java.util.Collections;
import java.util.List;

import org.apache.commons.lang.ObjectUtils;
import org.apache.torque.TorqueException;
import org.apache.torque.om.BaseObject;
import org.apache.torque.om.ComboKey;
import org.apache.torque.om.DateKey;
import org.apache.torque.om.NumberKey;
import org.apache.torque.om.ObjectKey;
import org.apache.torque.om.SimpleKey;
import org.apache.torque.om.StringKey;
import org.apache.torque.om.Persistent;
import org.apache.torque.util.Criteria;
import org.apache.torque.util.Transaction;


/**
 * This class was autogenerated by Torque on:
 *
 * [Fri Jan 09 02:39:32 PST 2009]
 *
 * You should not use this class directly.  It should not even be
 * extended all references should be to Student
 */
public abstract class BaseStudent extends BaseObject
{
    /** The Peer class */
    private static final StudentPeer peer =
        new StudentPeer();

        
    /** The value for the studentid field */
    private int studentid;
      
    /** The value for the studentnumber field */
    private String studentnumber;
      
    /** The value for the firstname field */
    private String firstname;
      
    /** The value for the middlename field */
    private String middlename;
      
    /** The value for the lastname field */
    private String lastname;
  
    
    /**
     * Get the Studentid
     *
     * @return int
     */
    public int getStudentid()
    {
        return studentid;
    }

                                              
    /**
     * Set the value of Studentid
     *
     * @param v new value
     */
    public void setStudentid(int v) throws TorqueException
    {
    
                  if (this.studentid != v)
              {
            this.studentid = v;
            setModified(true);
        }
    
          
                                  
        // update associated StudentPersonalInformation
        if (collStudentPersonalInformations != null)
        {
            for (int i = 0; i < collStudentPersonalInformations.size(); i++)
            {
                ((StudentPersonalInformation) collStudentPersonalInformations.get(i))
                    .setStudentid(v);
            }
        }
                                          
        // update associated StudentStfap
        if (collStudentStfaps != null)
        {
            for (int i = 0; i < collStudentStfaps.size(); i++)
            {
                ((StudentStfap) collStudentStfaps.get(i))
                    .setStudentid(v);
            }
        }
                                          
        // update associated StudentSignature
        if (collStudentSignatures != null)
        {
            for (int i = 0; i < collStudentSignatures.size(); i++)
            {
                ((StudentSignature) collStudentSignatures.get(i))
                    .setStudentid(v);
            }
        }
                                          
        // update associated StudentRgep
        if (collStudentRgeps != null)
        {
            for (int i = 0; i < collStudentRgeps.size(); i++)
            {
                ((StudentRgep) collStudentRgeps.get(i))
                    .setStudentid(v);
            }
        }
                                          
        // update associated StudentOverload
        if (collStudentOverloads != null)
        {
            for (int i = 0; i < collStudentOverloads.size(); i++)
            {
                ((StudentOverload) collStudentOverloads.get(i))
                    .setStudentid(v);
            }
        }
                                          
        // update associated StudentPreviousStatus
        if (collStudentPreviousStatuss != null)
        {
            for (int i = 0; i < collStudentPreviousStatuss.size(); i++)
            {
                ((StudentPreviousStatus) collStudentPreviousStatuss.get(i))
                    .setStudentid(v);
            }
        }
                                          
        // update associated StudentAdviser
        if (collStudentAdvisers != null)
        {
            for (int i = 0; i < collStudentAdvisers.size(); i++)
            {
                ((StudentAdviser) collStudentAdvisers.get(i))
                    .setStudentid(v);
            }
        }
                                          
        // update associated StudentClassification
        if (collStudentClassifications != null)
        {
            for (int i = 0; i < collStudentClassifications.size(); i++)
            {
                ((StudentClassification) collStudentClassifications.get(i))
                    .setStudentid(v);
            }
        }
                                          
        // update associated StudentCurriculum
        if (collStudentCurriculums != null)
        {
            for (int i = 0; i < collStudentCurriculums.size(); i++)
            {
                ((StudentCurriculum) collStudentCurriculums.get(i))
                    .setStudentid(v);
            }
        }
                                          
        // update associated StudentAllowedUnits
        if (collStudentAllowedUnitss != null)
        {
            for (int i = 0; i < collStudentAllowedUnitss.size(); i++)
            {
                ((StudentAllowedUnits) collStudentAllowedUnitss.get(i))
                    .setStudentid(v);
            }
        }
                                          
        // update associated StudentDegree
        if (collStudentDegrees != null)
        {
            for (int i = 0; i < collStudentDegrees.size(); i++)
            {
                ((StudentDegree) collStudentDegrees.get(i))
                    .setStudentid(v);
            }
        }
                                          
        // update associated StudentCollege
        if (collStudentColleges != null)
        {
            for (int i = 0; i < collStudentColleges.size(); i++)
            {
                ((StudentCollege) collStudentColleges.get(i))
                    .setStudentid(v);
            }
        }
                                          
        // update associated StudentPhoto
        if (collStudentPhotos != null)
        {
            for (int i = 0; i < collStudentPhotos.size(); i++)
            {
                ((StudentPhoto) collStudentPhotos.get(i))
                    .setStudentid(v);
            }
        }
                                          
        // update associated Grade
        if (collGrades != null)
        {
            for (int i = 0; i < collGrades.size(); i++)
            {
                ((Grade) collGrades.get(i))
                    .setStudentid(v);
            }
        }
                      }
  
    /**
     * Get the Studentnumber
     *
     * @return String
     */
    public String getStudentnumber()
    {
        return studentnumber;
    }

                        
    /**
     * Set the value of Studentnumber
     *
     * @param v new value
     */
    public void setStudentnumber(String v) 
    {
    
                  if (!ObjectUtils.equals(this.studentnumber, v))
              {
            this.studentnumber = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Firstname
     *
     * @return String
     */
    public String getFirstname()
    {
        return firstname;
    }

                        
    /**
     * Set the value of Firstname
     *
     * @param v new value
     */
    public void setFirstname(String v) 
    {
    
                  if (!ObjectUtils.equals(this.firstname, v))
              {
            this.firstname = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Middlename
     *
     * @return String
     */
    public String getMiddlename()
    {
        return middlename;
    }

                        
    /**
     * Set the value of Middlename
     *
     * @param v new value
     */
    public void setMiddlename(String v) 
    {
    
                  if (!ObjectUtils.equals(this.middlename, v))
              {
            this.middlename = v;
            setModified(true);
        }
    
          
              }
  
    /**
     * Get the Lastname
     *
     * @return String
     */
    public String getLastname()
    {
        return lastname;
    }

                        
    /**
     * Set the value of Lastname
     *
     * @param v new value
     */
    public void setLastname(String v) 
    {
    
                  if (!ObjectUtils.equals(this.lastname, v))
              {
            this.lastname = v;
            setModified(true);
        }
    
          
              }
  
         
                                
            
    /**
     * Collection to store aggregation of collStudentPersonalInformations
     */
    protected List collStudentPersonalInformations;

    /**
     * Temporary storage of collStudentPersonalInformations to save a possible db hit in
     * the event objects are add to the collection, but the
     * complete collection is never requested.
     */
    protected void initStudentPersonalInformations()
    {
        if (collStudentPersonalInformations == null)
        {
            collStudentPersonalInformations = new ArrayList();
        }
    }

    /**
     * Method called to associate a StudentPersonalInformation object to this object
     * through the StudentPersonalInformation foreign key attribute
     *
     * @param l StudentPersonalInformation
     * @throws TorqueException
     */
    public void addStudentPersonalInformation(StudentPersonalInformation l) throws TorqueException
    {
        getStudentPersonalInformations().add(l);
        l.setStudent((Student) this);
    }

    /**
     * The criteria used to select the current contents of collStudentPersonalInformations
     */
    private Criteria lastStudentPersonalInformationsCriteria = null;

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentPersonalInformations(new Criteria())
     *
     * @throws TorqueException
     */
    public List getStudentPersonalInformations() throws TorqueException
    {
        if (collStudentPersonalInformations == null)
        {
            collStudentPersonalInformations = getStudentPersonalInformations(new Criteria(10));
        }
        return collStudentPersonalInformations;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentPersonalInformations from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     *
     * @throws TorqueException
     */
    public List getStudentPersonalInformations(Criteria criteria) throws TorqueException
    {
        if (collStudentPersonalInformations == null)
        {
            if (isNew())
            {
               collStudentPersonalInformations = new ArrayList();
            }
            else
            {
                      criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid() );
                      collStudentPersonalInformations = StudentPersonalInformationPeer.doSelect(criteria);
            }
        }
        else
        {
            // criteria has no effect for a new object
            if (!isNew())
            {
                // the following code is to determine if a new query is
                // called for.  If the criteria is the same as the last
                // one, just return the collection.
                      criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                      if (!lastStudentPersonalInformationsCriteria.equals(criteria))
                {
                    collStudentPersonalInformations = StudentPersonalInformationPeer.doSelect(criteria);
                }
            }
        }
        lastStudentPersonalInformationsCriteria = criteria;

        return collStudentPersonalInformations;
    }

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentPersonalInformations(new Criteria(),Connection)
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentPersonalInformations(Connection con) throws TorqueException
    {
        if (collStudentPersonalInformations == null)
        {
            collStudentPersonalInformations = getStudentPersonalInformations(new Criteria(10), con);
        }
        return collStudentPersonalInformations;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentPersonalInformations from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentPersonalInformations(Criteria criteria, Connection con)
            throws TorqueException
    {
        if (collStudentPersonalInformations == null)
        {
            if (isNew())
            {
               collStudentPersonalInformations = new ArrayList();
            }
            else
            {
                       criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                       collStudentPersonalInformations = StudentPersonalInformationPeer.doSelect(criteria, con);
             }
         }
         else
         {
             // criteria has no effect for a new object
             if (!isNew())
             {
                 // the following code is to determine if a new query is
                 // called for.  If the criteria is the same as the last
                 // one, just return the collection.
                       criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                       if (!lastStudentPersonalInformationsCriteria.equals(criteria))
                 {
                     collStudentPersonalInformations = StudentPersonalInformationPeer.doSelect(criteria, con);
                 }
             }
         }
         lastStudentPersonalInformationsCriteria = criteria;

         return collStudentPersonalInformations;
     }

                                                                                          
              
                    
                              
                                
                                                              
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentPersonalInformations from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentPersonalInformationsJoinStudent(Criteria criteria)
        throws TorqueException
    {
        if (collStudentPersonalInformations == null)
        {
            if (isNew())
            {
               collStudentPersonalInformations = new ArrayList();
            }
            else
            {
                            criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                            collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinStudent(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                        if (!lastStudentPersonalInformationsCriteria.equals(criteria))
            {
                collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinStudent(criteria);
            }
        }
        lastStudentPersonalInformationsCriteria = criteria;

        return collStudentPersonalInformations;
    }
                  
                    
                    
                                            
                                                                          
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentPersonalInformations from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentPersonalInformationsJoinZipRelatedByResidentialaddresszipid(Criteria criteria)
        throws TorqueException
    {
        if (collStudentPersonalInformations == null)
        {
            if (isNew())
            {
               collStudentPersonalInformations = new ArrayList();
            }
            else
            {
                            criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                            collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinZipRelatedByResidentialaddresszipid(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                        if (!lastStudentPersonalInformationsCriteria.equals(criteria))
            {
                collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinZipRelatedByResidentialaddresszipid(criteria);
            }
        }
        lastStudentPersonalInformationsCriteria = criteria;

        return collStudentPersonalInformations;
    }
                  
                    
                    
                                            
                                                                          
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentPersonalInformations from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentPersonalInformationsJoinProvinceRelatedByResidentialaddressprovinceid(Criteria criteria)
        throws TorqueException
    {
        if (collStudentPersonalInformations == null)
        {
            if (isNew())
            {
               collStudentPersonalInformations = new ArrayList();
            }
            else
            {
                            criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                            collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinProvinceRelatedByResidentialaddressprovinceid(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                        if (!lastStudentPersonalInformationsCriteria.equals(criteria))
            {
                collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinProvinceRelatedByResidentialaddressprovinceid(criteria);
            }
        }
        lastStudentPersonalInformationsCriteria = criteria;

        return collStudentPersonalInformations;
    }
                  
                    
                    
                                            
                                                                          
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentPersonalInformations from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentPersonalInformationsJoinRegionRelatedByResidentialaddressregionid(Criteria criteria)
        throws TorqueException
    {
        if (collStudentPersonalInformations == null)
        {
            if (isNew())
            {
               collStudentPersonalInformations = new ArrayList();
            }
            else
            {
                            criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                            collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinRegionRelatedByResidentialaddressregionid(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                        if (!lastStudentPersonalInformationsCriteria.equals(criteria))
            {
                collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinRegionRelatedByResidentialaddressregionid(criteria);
            }
        }
        lastStudentPersonalInformationsCriteria = criteria;

        return collStudentPersonalInformations;
    }
                  
                    
                    
                                            
                                                                          
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentPersonalInformations from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentPersonalInformationsJoinCountryRelatedByResidentialaddresscountryid(Criteria criteria)
        throws TorqueException
    {
        if (collStudentPersonalInformations == null)
        {
            if (isNew())
            {
               collStudentPersonalInformations = new ArrayList();
            }
            else
            {
                            criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                            collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinCountryRelatedByResidentialaddresscountryid(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                        if (!lastStudentPersonalInformationsCriteria.equals(criteria))
            {
                collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinCountryRelatedByResidentialaddresscountryid(criteria);
            }
        }
        lastStudentPersonalInformationsCriteria = criteria;

        return collStudentPersonalInformations;
    }
                  
                    
                    
                                            
                                                                          
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentPersonalInformations from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentPersonalInformationsJoinZipRelatedByCollegeaddresszipid(Criteria criteria)
        throws TorqueException
    {
        if (collStudentPersonalInformations == null)
        {
            if (isNew())
            {
               collStudentPersonalInformations = new ArrayList();
            }
            else
            {
                            criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                            collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinZipRelatedByCollegeaddresszipid(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                        if (!lastStudentPersonalInformationsCriteria.equals(criteria))
            {
                collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinZipRelatedByCollegeaddresszipid(criteria);
            }
        }
        lastStudentPersonalInformationsCriteria = criteria;

        return collStudentPersonalInformations;
    }
                  
                    
                    
                                            
                                                                          
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentPersonalInformations from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentPersonalInformationsJoinProvinceRelatedByCollegeaddressprovinceid(Criteria criteria)
        throws TorqueException
    {
        if (collStudentPersonalInformations == null)
        {
            if (isNew())
            {
               collStudentPersonalInformations = new ArrayList();
            }
            else
            {
                            criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                            collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinProvinceRelatedByCollegeaddressprovinceid(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                        if (!lastStudentPersonalInformationsCriteria.equals(criteria))
            {
                collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinProvinceRelatedByCollegeaddressprovinceid(criteria);
            }
        }
        lastStudentPersonalInformationsCriteria = criteria;

        return collStudentPersonalInformations;
    }
                  
                    
                    
                                            
                                                                          
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentPersonalInformations from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentPersonalInformationsJoinRegionRelatedByCollegeaddressregionid(Criteria criteria)
        throws TorqueException
    {
        if (collStudentPersonalInformations == null)
        {
            if (isNew())
            {
               collStudentPersonalInformations = new ArrayList();
            }
            else
            {
                            criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                            collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinRegionRelatedByCollegeaddressregionid(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                        if (!lastStudentPersonalInformationsCriteria.equals(criteria))
            {
                collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinRegionRelatedByCollegeaddressregionid(criteria);
            }
        }
        lastStudentPersonalInformationsCriteria = criteria;

        return collStudentPersonalInformations;
    }
                  
                    
                    
                                            
                                                                          
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentPersonalInformations from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentPersonalInformationsJoinCountryRelatedByCollegeaddresscountryid(Criteria criteria)
        throws TorqueException
    {
        if (collStudentPersonalInformations == null)
        {
            if (isNew())
            {
               collStudentPersonalInformations = new ArrayList();
            }
            else
            {
                            criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                            collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinCountryRelatedByCollegeaddresscountryid(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                        if (!lastStudentPersonalInformationsCriteria.equals(criteria))
            {
                collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinCountryRelatedByCollegeaddresscountryid(criteria);
            }
        }
        lastStudentPersonalInformationsCriteria = criteria;

        return collStudentPersonalInformations;
    }
                  
                    
                    
                                            
                                                                          
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentPersonalInformations from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentPersonalInformationsJoinZipRelatedByGuardianaddresszipid(Criteria criteria)
        throws TorqueException
    {
        if (collStudentPersonalInformations == null)
        {
            if (isNew())
            {
               collStudentPersonalInformations = new ArrayList();
            }
            else
            {
                            criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                            collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinZipRelatedByGuardianaddresszipid(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                        if (!lastStudentPersonalInformationsCriteria.equals(criteria))
            {
                collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinZipRelatedByGuardianaddresszipid(criteria);
            }
        }
        lastStudentPersonalInformationsCriteria = criteria;

        return collStudentPersonalInformations;
    }
                  
                    
                    
                                            
                                                                          
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentPersonalInformations from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentPersonalInformationsJoinProvinceRelatedByGuardianaddressprovinceid(Criteria criteria)
        throws TorqueException
    {
        if (collStudentPersonalInformations == null)
        {
            if (isNew())
            {
               collStudentPersonalInformations = new ArrayList();
            }
            else
            {
                            criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                            collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinProvinceRelatedByGuardianaddressprovinceid(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                        if (!lastStudentPersonalInformationsCriteria.equals(criteria))
            {
                collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinProvinceRelatedByGuardianaddressprovinceid(criteria);
            }
        }
        lastStudentPersonalInformationsCriteria = criteria;

        return collStudentPersonalInformations;
    }
                  
                    
                    
                                            
                                                                          
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentPersonalInformations from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentPersonalInformationsJoinRegionRelatedByGuardianaddressregionid(Criteria criteria)
        throws TorqueException
    {
        if (collStudentPersonalInformations == null)
        {
            if (isNew())
            {
               collStudentPersonalInformations = new ArrayList();
            }
            else
            {
                            criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                            collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinRegionRelatedByGuardianaddressregionid(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                        if (!lastStudentPersonalInformationsCriteria.equals(criteria))
            {
                collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinRegionRelatedByGuardianaddressregionid(criteria);
            }
        }
        lastStudentPersonalInformationsCriteria = criteria;

        return collStudentPersonalInformations;
    }
                  
                    
                    
                                            
                                                                          
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentPersonalInformations from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentPersonalInformationsJoinCountryRelatedByGuardianaddresscountryid(Criteria criteria)
        throws TorqueException
    {
        if (collStudentPersonalInformations == null)
        {
            if (isNew())
            {
               collStudentPersonalInformations = new ArrayList();
            }
            else
            {
                            criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                            collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinCountryRelatedByGuardianaddresscountryid(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentPersonalInformationPeer.STUDENTID, getStudentid());
                        if (!lastStudentPersonalInformationsCriteria.equals(criteria))
            {
                collStudentPersonalInformations = StudentPersonalInformationPeer.doSelectJoinCountryRelatedByGuardianaddresscountryid(criteria);
            }
        }
        lastStudentPersonalInformationsCriteria = criteria;

        return collStudentPersonalInformations;
    }
                            


                          
            
    /**
     * Collection to store aggregation of collStudentStfaps
     */
    protected List collStudentStfaps;

    /**
     * Temporary storage of collStudentStfaps to save a possible db hit in
     * the event objects are add to the collection, but the
     * complete collection is never requested.
     */
    protected void initStudentStfaps()
    {
        if (collStudentStfaps == null)
        {
            collStudentStfaps = new ArrayList();
        }
    }

    /**
     * Method called to associate a StudentStfap object to this object
     * through the StudentStfap foreign key attribute
     *
     * @param l StudentStfap
     * @throws TorqueException
     */
    public void addStudentStfap(StudentStfap l) throws TorqueException
    {
        getStudentStfaps().add(l);
        l.setStudent((Student) this);
    }

    /**
     * The criteria used to select the current contents of collStudentStfaps
     */
    private Criteria lastStudentStfapsCriteria = null;

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentStfaps(new Criteria())
     *
     * @throws TorqueException
     */
    public List getStudentStfaps() throws TorqueException
    {
        if (collStudentStfaps == null)
        {
            collStudentStfaps = getStudentStfaps(new Criteria(10));
        }
        return collStudentStfaps;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentStfaps from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     *
     * @throws TorqueException
     */
    public List getStudentStfaps(Criteria criteria) throws TorqueException
    {
        if (collStudentStfaps == null)
        {
            if (isNew())
            {
               collStudentStfaps = new ArrayList();
            }
            else
            {
                      criteria.add(StudentStfapPeer.STUDENTID, getStudentid() );
                      collStudentStfaps = StudentStfapPeer.doSelect(criteria);
            }
        }
        else
        {
            // criteria has no effect for a new object
            if (!isNew())
            {
                // the following code is to determine if a new query is
                // called for.  If the criteria is the same as the last
                // one, just return the collection.
                      criteria.add(StudentStfapPeer.STUDENTID, getStudentid());
                      if (!lastStudentStfapsCriteria.equals(criteria))
                {
                    collStudentStfaps = StudentStfapPeer.doSelect(criteria);
                }
            }
        }
        lastStudentStfapsCriteria = criteria;

        return collStudentStfaps;
    }

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentStfaps(new Criteria(),Connection)
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentStfaps(Connection con) throws TorqueException
    {
        if (collStudentStfaps == null)
        {
            collStudentStfaps = getStudentStfaps(new Criteria(10), con);
        }
        return collStudentStfaps;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentStfaps from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentStfaps(Criteria criteria, Connection con)
            throws TorqueException
    {
        if (collStudentStfaps == null)
        {
            if (isNew())
            {
               collStudentStfaps = new ArrayList();
            }
            else
            {
                       criteria.add(StudentStfapPeer.STUDENTID, getStudentid());
                       collStudentStfaps = StudentStfapPeer.doSelect(criteria, con);
             }
         }
         else
         {
             // criteria has no effect for a new object
             if (!isNew())
             {
                 // the following code is to determine if a new query is
                 // called for.  If the criteria is the same as the last
                 // one, just return the collection.
                       criteria.add(StudentStfapPeer.STUDENTID, getStudentid());
                       if (!lastStudentStfapsCriteria.equals(criteria))
                 {
                     collStudentStfaps = StudentStfapPeer.doSelect(criteria, con);
                 }
             }
         }
         lastStudentStfapsCriteria = criteria;

         return collStudentStfaps;
     }

                  
              
                    
                              
                                
                                                              
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentStfaps from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentStfapsJoinStudent(Criteria criteria)
        throws TorqueException
    {
        if (collStudentStfaps == null)
        {
            if (isNew())
            {
               collStudentStfaps = new ArrayList();
            }
            else
            {
                            criteria.add(StudentStfapPeer.STUDENTID, getStudentid());
                            collStudentStfaps = StudentStfapPeer.doSelectJoinStudent(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentStfapPeer.STUDENTID, getStudentid());
                        if (!lastStudentStfapsCriteria.equals(criteria))
            {
                collStudentStfaps = StudentStfapPeer.doSelectJoinStudent(criteria);
            }
        }
        lastStudentStfapsCriteria = criteria;

        return collStudentStfaps;
    }
                            


                          
            
    /**
     * Collection to store aggregation of collStudentSignatures
     */
    protected List collStudentSignatures;

    /**
     * Temporary storage of collStudentSignatures to save a possible db hit in
     * the event objects are add to the collection, but the
     * complete collection is never requested.
     */
    protected void initStudentSignatures()
    {
        if (collStudentSignatures == null)
        {
            collStudentSignatures = new ArrayList();
        }
    }

    /**
     * Method called to associate a StudentSignature object to this object
     * through the StudentSignature foreign key attribute
     *
     * @param l StudentSignature
     * @throws TorqueException
     */
    public void addStudentSignature(StudentSignature l) throws TorqueException
    {
        getStudentSignatures().add(l);
        l.setStudent((Student) this);
    }

    /**
     * The criteria used to select the current contents of collStudentSignatures
     */
    private Criteria lastStudentSignaturesCriteria = null;

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentSignatures(new Criteria())
     *
     * @throws TorqueException
     */
    public List getStudentSignatures() throws TorqueException
    {
        if (collStudentSignatures == null)
        {
            collStudentSignatures = getStudentSignatures(new Criteria(10));
        }
        return collStudentSignatures;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentSignatures from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     *
     * @throws TorqueException
     */
    public List getStudentSignatures(Criteria criteria) throws TorqueException
    {
        if (collStudentSignatures == null)
        {
            if (isNew())
            {
               collStudentSignatures = new ArrayList();
            }
            else
            {
                      criteria.add(StudentSignaturePeer.STUDENTID, getStudentid() );
                      collStudentSignatures = StudentSignaturePeer.doSelect(criteria);
            }
        }
        else
        {
            // criteria has no effect for a new object
            if (!isNew())
            {
                // the following code is to determine if a new query is
                // called for.  If the criteria is the same as the last
                // one, just return the collection.
                      criteria.add(StudentSignaturePeer.STUDENTID, getStudentid());
                      if (!lastStudentSignaturesCriteria.equals(criteria))
                {
                    collStudentSignatures = StudentSignaturePeer.doSelect(criteria);
                }
            }
        }
        lastStudentSignaturesCriteria = criteria;

        return collStudentSignatures;
    }

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentSignatures(new Criteria(),Connection)
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentSignatures(Connection con) throws TorqueException
    {
        if (collStudentSignatures == null)
        {
            collStudentSignatures = getStudentSignatures(new Criteria(10), con);
        }
        return collStudentSignatures;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentSignatures from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentSignatures(Criteria criteria, Connection con)
            throws TorqueException
    {
        if (collStudentSignatures == null)
        {
            if (isNew())
            {
               collStudentSignatures = new ArrayList();
            }
            else
            {
                       criteria.add(StudentSignaturePeer.STUDENTID, getStudentid());
                       collStudentSignatures = StudentSignaturePeer.doSelect(criteria, con);
             }
         }
         else
         {
             // criteria has no effect for a new object
             if (!isNew())
             {
                 // the following code is to determine if a new query is
                 // called for.  If the criteria is the same as the last
                 // one, just return the collection.
                       criteria.add(StudentSignaturePeer.STUDENTID, getStudentid());
                       if (!lastStudentSignaturesCriteria.equals(criteria))
                 {
                     collStudentSignatures = StudentSignaturePeer.doSelect(criteria, con);
                 }
             }
         }
         lastStudentSignaturesCriteria = criteria;

         return collStudentSignatures;
     }

                  
              
                    
                              
                                
                                                              
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentSignatures from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentSignaturesJoinStudent(Criteria criteria)
        throws TorqueException
    {
        if (collStudentSignatures == null)
        {
            if (isNew())
            {
               collStudentSignatures = new ArrayList();
            }
            else
            {
                            criteria.add(StudentSignaturePeer.STUDENTID, getStudentid());
                            collStudentSignatures = StudentSignaturePeer.doSelectJoinStudent(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentSignaturePeer.STUDENTID, getStudentid());
                        if (!lastStudentSignaturesCriteria.equals(criteria))
            {
                collStudentSignatures = StudentSignaturePeer.doSelectJoinStudent(criteria);
            }
        }
        lastStudentSignaturesCriteria = criteria;

        return collStudentSignatures;
    }
                            


                          
            
    /**
     * Collection to store aggregation of collStudentRgeps
     */
    protected List collStudentRgeps;

    /**
     * Temporary storage of collStudentRgeps to save a possible db hit in
     * the event objects are add to the collection, but the
     * complete collection is never requested.
     */
    protected void initStudentRgeps()
    {
        if (collStudentRgeps == null)
        {
            collStudentRgeps = new ArrayList();
        }
    }

    /**
     * Method called to associate a StudentRgep object to this object
     * through the StudentRgep foreign key attribute
     *
     * @param l StudentRgep
     * @throws TorqueException
     */
    public void addStudentRgep(StudentRgep l) throws TorqueException
    {
        getStudentRgeps().add(l);
        l.setStudent((Student) this);
    }

    /**
     * The criteria used to select the current contents of collStudentRgeps
     */
    private Criteria lastStudentRgepsCriteria = null;

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentRgeps(new Criteria())
     *
     * @throws TorqueException
     */
    public List getStudentRgeps() throws TorqueException
    {
        if (collStudentRgeps == null)
        {
            collStudentRgeps = getStudentRgeps(new Criteria(10));
        }
        return collStudentRgeps;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentRgeps from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     *
     * @throws TorqueException
     */
    public List getStudentRgeps(Criteria criteria) throws TorqueException
    {
        if (collStudentRgeps == null)
        {
            if (isNew())
            {
               collStudentRgeps = new ArrayList();
            }
            else
            {
                      criteria.add(StudentRgepPeer.STUDENTID, getStudentid() );
                      collStudentRgeps = StudentRgepPeer.doSelect(criteria);
            }
        }
        else
        {
            // criteria has no effect for a new object
            if (!isNew())
            {
                // the following code is to determine if a new query is
                // called for.  If the criteria is the same as the last
                // one, just return the collection.
                      criteria.add(StudentRgepPeer.STUDENTID, getStudentid());
                      if (!lastStudentRgepsCriteria.equals(criteria))
                {
                    collStudentRgeps = StudentRgepPeer.doSelect(criteria);
                }
            }
        }
        lastStudentRgepsCriteria = criteria;

        return collStudentRgeps;
    }

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentRgeps(new Criteria(),Connection)
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentRgeps(Connection con) throws TorqueException
    {
        if (collStudentRgeps == null)
        {
            collStudentRgeps = getStudentRgeps(new Criteria(10), con);
        }
        return collStudentRgeps;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentRgeps from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentRgeps(Criteria criteria, Connection con)
            throws TorqueException
    {
        if (collStudentRgeps == null)
        {
            if (isNew())
            {
               collStudentRgeps = new ArrayList();
            }
            else
            {
                       criteria.add(StudentRgepPeer.STUDENTID, getStudentid());
                       collStudentRgeps = StudentRgepPeer.doSelect(criteria, con);
             }
         }
         else
         {
             // criteria has no effect for a new object
             if (!isNew())
             {
                 // the following code is to determine if a new query is
                 // called for.  If the criteria is the same as the last
                 // one, just return the collection.
                       criteria.add(StudentRgepPeer.STUDENTID, getStudentid());
                       if (!lastStudentRgepsCriteria.equals(criteria))
                 {
                     collStudentRgeps = StudentRgepPeer.doSelect(criteria, con);
                 }
             }
         }
         lastStudentRgepsCriteria = criteria;

         return collStudentRgeps;
     }

                  
              
                    
                              
                                
                                                              
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentRgeps from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentRgepsJoinStudent(Criteria criteria)
        throws TorqueException
    {
        if (collStudentRgeps == null)
        {
            if (isNew())
            {
               collStudentRgeps = new ArrayList();
            }
            else
            {
                            criteria.add(StudentRgepPeer.STUDENTID, getStudentid());
                            collStudentRgeps = StudentRgepPeer.doSelectJoinStudent(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentRgepPeer.STUDENTID, getStudentid());
                        if (!lastStudentRgepsCriteria.equals(criteria))
            {
                collStudentRgeps = StudentRgepPeer.doSelectJoinStudent(criteria);
            }
        }
        lastStudentRgepsCriteria = criteria;

        return collStudentRgeps;
    }
                            


                          
            
    /**
     * Collection to store aggregation of collStudentOverloads
     */
    protected List collStudentOverloads;

    /**
     * Temporary storage of collStudentOverloads to save a possible db hit in
     * the event objects are add to the collection, but the
     * complete collection is never requested.
     */
    protected void initStudentOverloads()
    {
        if (collStudentOverloads == null)
        {
            collStudentOverloads = new ArrayList();
        }
    }

    /**
     * Method called to associate a StudentOverload object to this object
     * through the StudentOverload foreign key attribute
     *
     * @param l StudentOverload
     * @throws TorqueException
     */
    public void addStudentOverload(StudentOverload l) throws TorqueException
    {
        getStudentOverloads().add(l);
        l.setStudent((Student) this);
    }

    /**
     * The criteria used to select the current contents of collStudentOverloads
     */
    private Criteria lastStudentOverloadsCriteria = null;

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentOverloads(new Criteria())
     *
     * @throws TorqueException
     */
    public List getStudentOverloads() throws TorqueException
    {
        if (collStudentOverloads == null)
        {
            collStudentOverloads = getStudentOverloads(new Criteria(10));
        }
        return collStudentOverloads;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentOverloads from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     *
     * @throws TorqueException
     */
    public List getStudentOverloads(Criteria criteria) throws TorqueException
    {
        if (collStudentOverloads == null)
        {
            if (isNew())
            {
               collStudentOverloads = new ArrayList();
            }
            else
            {
                      criteria.add(StudentOverloadPeer.STUDENTID, getStudentid() );
                      collStudentOverloads = StudentOverloadPeer.doSelect(criteria);
            }
        }
        else
        {
            // criteria has no effect for a new object
            if (!isNew())
            {
                // the following code is to determine if a new query is
                // called for.  If the criteria is the same as the last
                // one, just return the collection.
                      criteria.add(StudentOverloadPeer.STUDENTID, getStudentid());
                      if (!lastStudentOverloadsCriteria.equals(criteria))
                {
                    collStudentOverloads = StudentOverloadPeer.doSelect(criteria);
                }
            }
        }
        lastStudentOverloadsCriteria = criteria;

        return collStudentOverloads;
    }

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentOverloads(new Criteria(),Connection)
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentOverloads(Connection con) throws TorqueException
    {
        if (collStudentOverloads == null)
        {
            collStudentOverloads = getStudentOverloads(new Criteria(10), con);
        }
        return collStudentOverloads;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentOverloads from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentOverloads(Criteria criteria, Connection con)
            throws TorqueException
    {
        if (collStudentOverloads == null)
        {
            if (isNew())
            {
               collStudentOverloads = new ArrayList();
            }
            else
            {
                       criteria.add(StudentOverloadPeer.STUDENTID, getStudentid());
                       collStudentOverloads = StudentOverloadPeer.doSelect(criteria, con);
             }
         }
         else
         {
             // criteria has no effect for a new object
             if (!isNew())
             {
                 // the following code is to determine if a new query is
                 // called for.  If the criteria is the same as the last
                 // one, just return the collection.
                       criteria.add(StudentOverloadPeer.STUDENTID, getStudentid());
                       if (!lastStudentOverloadsCriteria.equals(criteria))
                 {
                     collStudentOverloads = StudentOverloadPeer.doSelect(criteria, con);
                 }
             }
         }
         lastStudentOverloadsCriteria = criteria;

         return collStudentOverloads;
     }

                  
              
                    
                              
                                
                                                              
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentOverloads from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentOverloadsJoinStudent(Criteria criteria)
        throws TorqueException
    {
        if (collStudentOverloads == null)
        {
            if (isNew())
            {
               collStudentOverloads = new ArrayList();
            }
            else
            {
                            criteria.add(StudentOverloadPeer.STUDENTID, getStudentid());
                            collStudentOverloads = StudentOverloadPeer.doSelectJoinStudent(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentOverloadPeer.STUDENTID, getStudentid());
                        if (!lastStudentOverloadsCriteria.equals(criteria))
            {
                collStudentOverloads = StudentOverloadPeer.doSelectJoinStudent(criteria);
            }
        }
        lastStudentOverloadsCriteria = criteria;

        return collStudentOverloads;
    }
                            


                          
            
    /**
     * Collection to store aggregation of collStudentPreviousStatuss
     */
    protected List collStudentPreviousStatuss;

    /**
     * Temporary storage of collStudentPreviousStatuss to save a possible db hit in
     * the event objects are add to the collection, but the
     * complete collection is never requested.
     */
    protected void initStudentPreviousStatuss()
    {
        if (collStudentPreviousStatuss == null)
        {
            collStudentPreviousStatuss = new ArrayList();
        }
    }

    /**
     * Method called to associate a StudentPreviousStatus object to this object
     * through the StudentPreviousStatus foreign key attribute
     *
     * @param l StudentPreviousStatus
     * @throws TorqueException
     */
    public void addStudentPreviousStatus(StudentPreviousStatus l) throws TorqueException
    {
        getStudentPreviousStatuss().add(l);
        l.setStudent((Student) this);
    }

    /**
     * The criteria used to select the current contents of collStudentPreviousStatuss
     */
    private Criteria lastStudentPreviousStatussCriteria = null;

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentPreviousStatuss(new Criteria())
     *
     * @throws TorqueException
     */
    public List getStudentPreviousStatuss() throws TorqueException
    {
        if (collStudentPreviousStatuss == null)
        {
            collStudentPreviousStatuss = getStudentPreviousStatuss(new Criteria(10));
        }
        return collStudentPreviousStatuss;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentPreviousStatuss from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     *
     * @throws TorqueException
     */
    public List getStudentPreviousStatuss(Criteria criteria) throws TorqueException
    {
        if (collStudentPreviousStatuss == null)
        {
            if (isNew())
            {
               collStudentPreviousStatuss = new ArrayList();
            }
            else
            {
                      criteria.add(StudentPreviousStatusPeer.STUDENTID, getStudentid() );
                      collStudentPreviousStatuss = StudentPreviousStatusPeer.doSelect(criteria);
            }
        }
        else
        {
            // criteria has no effect for a new object
            if (!isNew())
            {
                // the following code is to determine if a new query is
                // called for.  If the criteria is the same as the last
                // one, just return the collection.
                      criteria.add(StudentPreviousStatusPeer.STUDENTID, getStudentid());
                      if (!lastStudentPreviousStatussCriteria.equals(criteria))
                {
                    collStudentPreviousStatuss = StudentPreviousStatusPeer.doSelect(criteria);
                }
            }
        }
        lastStudentPreviousStatussCriteria = criteria;

        return collStudentPreviousStatuss;
    }

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentPreviousStatuss(new Criteria(),Connection)
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentPreviousStatuss(Connection con) throws TorqueException
    {
        if (collStudentPreviousStatuss == null)
        {
            collStudentPreviousStatuss = getStudentPreviousStatuss(new Criteria(10), con);
        }
        return collStudentPreviousStatuss;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentPreviousStatuss from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentPreviousStatuss(Criteria criteria, Connection con)
            throws TorqueException
    {
        if (collStudentPreviousStatuss == null)
        {
            if (isNew())
            {
               collStudentPreviousStatuss = new ArrayList();
            }
            else
            {
                       criteria.add(StudentPreviousStatusPeer.STUDENTID, getStudentid());
                       collStudentPreviousStatuss = StudentPreviousStatusPeer.doSelect(criteria, con);
             }
         }
         else
         {
             // criteria has no effect for a new object
             if (!isNew())
             {
                 // the following code is to determine if a new query is
                 // called for.  If the criteria is the same as the last
                 // one, just return the collection.
                       criteria.add(StudentPreviousStatusPeer.STUDENTID, getStudentid());
                       if (!lastStudentPreviousStatussCriteria.equals(criteria))
                 {
                     collStudentPreviousStatuss = StudentPreviousStatusPeer.doSelect(criteria, con);
                 }
             }
         }
         lastStudentPreviousStatussCriteria = criteria;

         return collStudentPreviousStatuss;
     }

                  
              
                    
                              
                                
                                                              
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentPreviousStatuss from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentPreviousStatussJoinStudent(Criteria criteria)
        throws TorqueException
    {
        if (collStudentPreviousStatuss == null)
        {
            if (isNew())
            {
               collStudentPreviousStatuss = new ArrayList();
            }
            else
            {
                            criteria.add(StudentPreviousStatusPeer.STUDENTID, getStudentid());
                            collStudentPreviousStatuss = StudentPreviousStatusPeer.doSelectJoinStudent(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentPreviousStatusPeer.STUDENTID, getStudentid());
                        if (!lastStudentPreviousStatussCriteria.equals(criteria))
            {
                collStudentPreviousStatuss = StudentPreviousStatusPeer.doSelectJoinStudent(criteria);
            }
        }
        lastStudentPreviousStatussCriteria = criteria;

        return collStudentPreviousStatuss;
    }
                            


                          
            
    /**
     * Collection to store aggregation of collStudentAdvisers
     */
    protected List collStudentAdvisers;

    /**
     * Temporary storage of collStudentAdvisers to save a possible db hit in
     * the event objects are add to the collection, but the
     * complete collection is never requested.
     */
    protected void initStudentAdvisers()
    {
        if (collStudentAdvisers == null)
        {
            collStudentAdvisers = new ArrayList();
        }
    }

    /**
     * Method called to associate a StudentAdviser object to this object
     * through the StudentAdviser foreign key attribute
     *
     * @param l StudentAdviser
     * @throws TorqueException
     */
    public void addStudentAdviser(StudentAdviser l) throws TorqueException
    {
        getStudentAdvisers().add(l);
        l.setStudent((Student) this);
    }

    /**
     * The criteria used to select the current contents of collStudentAdvisers
     */
    private Criteria lastStudentAdvisersCriteria = null;

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentAdvisers(new Criteria())
     *
     * @throws TorqueException
     */
    public List getStudentAdvisers() throws TorqueException
    {
        if (collStudentAdvisers == null)
        {
            collStudentAdvisers = getStudentAdvisers(new Criteria(10));
        }
        return collStudentAdvisers;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentAdvisers from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     *
     * @throws TorqueException
     */
    public List getStudentAdvisers(Criteria criteria) throws TorqueException
    {
        if (collStudentAdvisers == null)
        {
            if (isNew())
            {
               collStudentAdvisers = new ArrayList();
            }
            else
            {
                      criteria.add(StudentAdviserPeer.STUDENTID, getStudentid() );
                      collStudentAdvisers = StudentAdviserPeer.doSelect(criteria);
            }
        }
        else
        {
            // criteria has no effect for a new object
            if (!isNew())
            {
                // the following code is to determine if a new query is
                // called for.  If the criteria is the same as the last
                // one, just return the collection.
                      criteria.add(StudentAdviserPeer.STUDENTID, getStudentid());
                      if (!lastStudentAdvisersCriteria.equals(criteria))
                {
                    collStudentAdvisers = StudentAdviserPeer.doSelect(criteria);
                }
            }
        }
        lastStudentAdvisersCriteria = criteria;

        return collStudentAdvisers;
    }

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentAdvisers(new Criteria(),Connection)
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentAdvisers(Connection con) throws TorqueException
    {
        if (collStudentAdvisers == null)
        {
            collStudentAdvisers = getStudentAdvisers(new Criteria(10), con);
        }
        return collStudentAdvisers;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentAdvisers from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentAdvisers(Criteria criteria, Connection con)
            throws TorqueException
    {
        if (collStudentAdvisers == null)
        {
            if (isNew())
            {
               collStudentAdvisers = new ArrayList();
            }
            else
            {
                       criteria.add(StudentAdviserPeer.STUDENTID, getStudentid());
                       collStudentAdvisers = StudentAdviserPeer.doSelect(criteria, con);
             }
         }
         else
         {
             // criteria has no effect for a new object
             if (!isNew())
             {
                 // the following code is to determine if a new query is
                 // called for.  If the criteria is the same as the last
                 // one, just return the collection.
                       criteria.add(StudentAdviserPeer.STUDENTID, getStudentid());
                       if (!lastStudentAdvisersCriteria.equals(criteria))
                 {
                     collStudentAdvisers = StudentAdviserPeer.doSelect(criteria, con);
                 }
             }
         }
         lastStudentAdvisersCriteria = criteria;

         return collStudentAdvisers;
     }

                        
              
                    
                              
                                
                                                              
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentAdvisers from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentAdvisersJoinStudent(Criteria criteria)
        throws TorqueException
    {
        if (collStudentAdvisers == null)
        {
            if (isNew())
            {
               collStudentAdvisers = new ArrayList();
            }
            else
            {
                            criteria.add(StudentAdviserPeer.STUDENTID, getStudentid());
                            collStudentAdvisers = StudentAdviserPeer.doSelectJoinStudent(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentAdviserPeer.STUDENTID, getStudentid());
                        if (!lastStudentAdvisersCriteria.equals(criteria))
            {
                collStudentAdvisers = StudentAdviserPeer.doSelectJoinStudent(criteria);
            }
        }
        lastStudentAdvisersCriteria = criteria;

        return collStudentAdvisers;
    }
                  
                    
                    
                                
                                                              
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentAdvisers from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentAdvisersJoinEmployee(Criteria criteria)
        throws TorqueException
    {
        if (collStudentAdvisers == null)
        {
            if (isNew())
            {
               collStudentAdvisers = new ArrayList();
            }
            else
            {
                            criteria.add(StudentAdviserPeer.STUDENTID, getStudentid());
                            collStudentAdvisers = StudentAdviserPeer.doSelectJoinEmployee(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentAdviserPeer.STUDENTID, getStudentid());
                        if (!lastStudentAdvisersCriteria.equals(criteria))
            {
                collStudentAdvisers = StudentAdviserPeer.doSelectJoinEmployee(criteria);
            }
        }
        lastStudentAdvisersCriteria = criteria;

        return collStudentAdvisers;
    }
                            


                          
            
    /**
     * Collection to store aggregation of collStudentClassifications
     */
    protected List collStudentClassifications;

    /**
     * Temporary storage of collStudentClassifications to save a possible db hit in
     * the event objects are add to the collection, but the
     * complete collection is never requested.
     */
    protected void initStudentClassifications()
    {
        if (collStudentClassifications == null)
        {
            collStudentClassifications = new ArrayList();
        }
    }

    /**
     * Method called to associate a StudentClassification object to this object
     * through the StudentClassification foreign key attribute
     *
     * @param l StudentClassification
     * @throws TorqueException
     */
    public void addStudentClassification(StudentClassification l) throws TorqueException
    {
        getStudentClassifications().add(l);
        l.setStudent((Student) this);
    }

    /**
     * The criteria used to select the current contents of collStudentClassifications
     */
    private Criteria lastStudentClassificationsCriteria = null;

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentClassifications(new Criteria())
     *
     * @throws TorqueException
     */
    public List getStudentClassifications() throws TorqueException
    {
        if (collStudentClassifications == null)
        {
            collStudentClassifications = getStudentClassifications(new Criteria(10));
        }
        return collStudentClassifications;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentClassifications from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     *
     * @throws TorqueException
     */
    public List getStudentClassifications(Criteria criteria) throws TorqueException
    {
        if (collStudentClassifications == null)
        {
            if (isNew())
            {
               collStudentClassifications = new ArrayList();
            }
            else
            {
                      criteria.add(StudentClassificationPeer.STUDENTID, getStudentid() );
                      collStudentClassifications = StudentClassificationPeer.doSelect(criteria);
            }
        }
        else
        {
            // criteria has no effect for a new object
            if (!isNew())
            {
                // the following code is to determine if a new query is
                // called for.  If the criteria is the same as the last
                // one, just return the collection.
                      criteria.add(StudentClassificationPeer.STUDENTID, getStudentid());
                      if (!lastStudentClassificationsCriteria.equals(criteria))
                {
                    collStudentClassifications = StudentClassificationPeer.doSelect(criteria);
                }
            }
        }
        lastStudentClassificationsCriteria = criteria;

        return collStudentClassifications;
    }

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentClassifications(new Criteria(),Connection)
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentClassifications(Connection con) throws TorqueException
    {
        if (collStudentClassifications == null)
        {
            collStudentClassifications = getStudentClassifications(new Criteria(10), con);
        }
        return collStudentClassifications;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentClassifications from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentClassifications(Criteria criteria, Connection con)
            throws TorqueException
    {
        if (collStudentClassifications == null)
        {
            if (isNew())
            {
               collStudentClassifications = new ArrayList();
            }
            else
            {
                       criteria.add(StudentClassificationPeer.STUDENTID, getStudentid());
                       collStudentClassifications = StudentClassificationPeer.doSelect(criteria, con);
             }
         }
         else
         {
             // criteria has no effect for a new object
             if (!isNew())
             {
                 // the following code is to determine if a new query is
                 // called for.  If the criteria is the same as the last
                 // one, just return the collection.
                       criteria.add(StudentClassificationPeer.STUDENTID, getStudentid());
                       if (!lastStudentClassificationsCriteria.equals(criteria))
                 {
                     collStudentClassifications = StudentClassificationPeer.doSelect(criteria, con);
                 }
             }
         }
         lastStudentClassificationsCriteria = criteria;

         return collStudentClassifications;
     }

                  
              
                    
                              
                                
                                                              
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentClassifications from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentClassificationsJoinStudent(Criteria criteria)
        throws TorqueException
    {
        if (collStudentClassifications == null)
        {
            if (isNew())
            {
               collStudentClassifications = new ArrayList();
            }
            else
            {
                            criteria.add(StudentClassificationPeer.STUDENTID, getStudentid());
                            collStudentClassifications = StudentClassificationPeer.doSelectJoinStudent(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentClassificationPeer.STUDENTID, getStudentid());
                        if (!lastStudentClassificationsCriteria.equals(criteria))
            {
                collStudentClassifications = StudentClassificationPeer.doSelectJoinStudent(criteria);
            }
        }
        lastStudentClassificationsCriteria = criteria;

        return collStudentClassifications;
    }
                            


                          
            
    /**
     * Collection to store aggregation of collStudentCurriculums
     */
    protected List collStudentCurriculums;

    /**
     * Temporary storage of collStudentCurriculums to save a possible db hit in
     * the event objects are add to the collection, but the
     * complete collection is never requested.
     */
    protected void initStudentCurriculums()
    {
        if (collStudentCurriculums == null)
        {
            collStudentCurriculums = new ArrayList();
        }
    }

    /**
     * Method called to associate a StudentCurriculum object to this object
     * through the StudentCurriculum foreign key attribute
     *
     * @param l StudentCurriculum
     * @throws TorqueException
     */
    public void addStudentCurriculum(StudentCurriculum l) throws TorqueException
    {
        getStudentCurriculums().add(l);
        l.setStudent((Student) this);
    }

    /**
     * The criteria used to select the current contents of collStudentCurriculums
     */
    private Criteria lastStudentCurriculumsCriteria = null;

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentCurriculums(new Criteria())
     *
     * @throws TorqueException
     */
    public List getStudentCurriculums() throws TorqueException
    {
        if (collStudentCurriculums == null)
        {
            collStudentCurriculums = getStudentCurriculums(new Criteria(10));
        }
        return collStudentCurriculums;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentCurriculums from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     *
     * @throws TorqueException
     */
    public List getStudentCurriculums(Criteria criteria) throws TorqueException
    {
        if (collStudentCurriculums == null)
        {
            if (isNew())
            {
               collStudentCurriculums = new ArrayList();
            }
            else
            {
                      criteria.add(StudentCurriculumPeer.STUDENTID, getStudentid() );
                      collStudentCurriculums = StudentCurriculumPeer.doSelect(criteria);
            }
        }
        else
        {
            // criteria has no effect for a new object
            if (!isNew())
            {
                // the following code is to determine if a new query is
                // called for.  If the criteria is the same as the last
                // one, just return the collection.
                      criteria.add(StudentCurriculumPeer.STUDENTID, getStudentid());
                      if (!lastStudentCurriculumsCriteria.equals(criteria))
                {
                    collStudentCurriculums = StudentCurriculumPeer.doSelect(criteria);
                }
            }
        }
        lastStudentCurriculumsCriteria = criteria;

        return collStudentCurriculums;
    }

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentCurriculums(new Criteria(),Connection)
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentCurriculums(Connection con) throws TorqueException
    {
        if (collStudentCurriculums == null)
        {
            collStudentCurriculums = getStudentCurriculums(new Criteria(10), con);
        }
        return collStudentCurriculums;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentCurriculums from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentCurriculums(Criteria criteria, Connection con)
            throws TorqueException
    {
        if (collStudentCurriculums == null)
        {
            if (isNew())
            {
               collStudentCurriculums = new ArrayList();
            }
            else
            {
                       criteria.add(StudentCurriculumPeer.STUDENTID, getStudentid());
                       collStudentCurriculums = StudentCurriculumPeer.doSelect(criteria, con);
             }
         }
         else
         {
             // criteria has no effect for a new object
             if (!isNew())
             {
                 // the following code is to determine if a new query is
                 // called for.  If the criteria is the same as the last
                 // one, just return the collection.
                       criteria.add(StudentCurriculumPeer.STUDENTID, getStudentid());
                       if (!lastStudentCurriculumsCriteria.equals(criteria))
                 {
                     collStudentCurriculums = StudentCurriculumPeer.doSelect(criteria, con);
                 }
             }
         }
         lastStudentCurriculumsCriteria = criteria;

         return collStudentCurriculums;
     }

                        
              
                    
                              
                                
                                                              
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentCurriculums from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentCurriculumsJoinStudent(Criteria criteria)
        throws TorqueException
    {
        if (collStudentCurriculums == null)
        {
            if (isNew())
            {
               collStudentCurriculums = new ArrayList();
            }
            else
            {
                            criteria.add(StudentCurriculumPeer.STUDENTID, getStudentid());
                            collStudentCurriculums = StudentCurriculumPeer.doSelectJoinStudent(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentCurriculumPeer.STUDENTID, getStudentid());
                        if (!lastStudentCurriculumsCriteria.equals(criteria))
            {
                collStudentCurriculums = StudentCurriculumPeer.doSelectJoinStudent(criteria);
            }
        }
        lastStudentCurriculumsCriteria = criteria;

        return collStudentCurriculums;
    }
                  
                    
                    
                                
                                                              
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentCurriculums from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentCurriculumsJoinCurriculum(Criteria criteria)
        throws TorqueException
    {
        if (collStudentCurriculums == null)
        {
            if (isNew())
            {
               collStudentCurriculums = new ArrayList();
            }
            else
            {
                            criteria.add(StudentCurriculumPeer.STUDENTID, getStudentid());
                            collStudentCurriculums = StudentCurriculumPeer.doSelectJoinCurriculum(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentCurriculumPeer.STUDENTID, getStudentid());
                        if (!lastStudentCurriculumsCriteria.equals(criteria))
            {
                collStudentCurriculums = StudentCurriculumPeer.doSelectJoinCurriculum(criteria);
            }
        }
        lastStudentCurriculumsCriteria = criteria;

        return collStudentCurriculums;
    }
                            


                          
            
    /**
     * Collection to store aggregation of collStudentAllowedUnitss
     */
    protected List collStudentAllowedUnitss;

    /**
     * Temporary storage of collStudentAllowedUnitss to save a possible db hit in
     * the event objects are add to the collection, but the
     * complete collection is never requested.
     */
    protected void initStudentAllowedUnitss()
    {
        if (collStudentAllowedUnitss == null)
        {
            collStudentAllowedUnitss = new ArrayList();
        }
    }

    /**
     * Method called to associate a StudentAllowedUnits object to this object
     * through the StudentAllowedUnits foreign key attribute
     *
     * @param l StudentAllowedUnits
     * @throws TorqueException
     */
    public void addStudentAllowedUnits(StudentAllowedUnits l) throws TorqueException
    {
        getStudentAllowedUnitss().add(l);
        l.setStudent((Student) this);
    }

    /**
     * The criteria used to select the current contents of collStudentAllowedUnitss
     */
    private Criteria lastStudentAllowedUnitssCriteria = null;

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentAllowedUnitss(new Criteria())
     *
     * @throws TorqueException
     */
    public List getStudentAllowedUnitss() throws TorqueException
    {
        if (collStudentAllowedUnitss == null)
        {
            collStudentAllowedUnitss = getStudentAllowedUnitss(new Criteria(10));
        }
        return collStudentAllowedUnitss;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentAllowedUnitss from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     *
     * @throws TorqueException
     */
    public List getStudentAllowedUnitss(Criteria criteria) throws TorqueException
    {
        if (collStudentAllowedUnitss == null)
        {
            if (isNew())
            {
               collStudentAllowedUnitss = new ArrayList();
            }
            else
            {
                      criteria.add(StudentAllowedUnitsPeer.STUDENTID, getStudentid() );
                      collStudentAllowedUnitss = StudentAllowedUnitsPeer.doSelect(criteria);
            }
        }
        else
        {
            // criteria has no effect for a new object
            if (!isNew())
            {
                // the following code is to determine if a new query is
                // called for.  If the criteria is the same as the last
                // one, just return the collection.
                      criteria.add(StudentAllowedUnitsPeer.STUDENTID, getStudentid());
                      if (!lastStudentAllowedUnitssCriteria.equals(criteria))
                {
                    collStudentAllowedUnitss = StudentAllowedUnitsPeer.doSelect(criteria);
                }
            }
        }
        lastStudentAllowedUnitssCriteria = criteria;

        return collStudentAllowedUnitss;
    }

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentAllowedUnitss(new Criteria(),Connection)
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentAllowedUnitss(Connection con) throws TorqueException
    {
        if (collStudentAllowedUnitss == null)
        {
            collStudentAllowedUnitss = getStudentAllowedUnitss(new Criteria(10), con);
        }
        return collStudentAllowedUnitss;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentAllowedUnitss from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentAllowedUnitss(Criteria criteria, Connection con)
            throws TorqueException
    {
        if (collStudentAllowedUnitss == null)
        {
            if (isNew())
            {
               collStudentAllowedUnitss = new ArrayList();
            }
            else
            {
                       criteria.add(StudentAllowedUnitsPeer.STUDENTID, getStudentid());
                       collStudentAllowedUnitss = StudentAllowedUnitsPeer.doSelect(criteria, con);
             }
         }
         else
         {
             // criteria has no effect for a new object
             if (!isNew())
             {
                 // the following code is to determine if a new query is
                 // called for.  If the criteria is the same as the last
                 // one, just return the collection.
                       criteria.add(StudentAllowedUnitsPeer.STUDENTID, getStudentid());
                       if (!lastStudentAllowedUnitssCriteria.equals(criteria))
                 {
                     collStudentAllowedUnitss = StudentAllowedUnitsPeer.doSelect(criteria, con);
                 }
             }
         }
         lastStudentAllowedUnitssCriteria = criteria;

         return collStudentAllowedUnitss;
     }

                  
              
                    
                              
                                
                                                              
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentAllowedUnitss from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentAllowedUnitssJoinStudent(Criteria criteria)
        throws TorqueException
    {
        if (collStudentAllowedUnitss == null)
        {
            if (isNew())
            {
               collStudentAllowedUnitss = new ArrayList();
            }
            else
            {
                            criteria.add(StudentAllowedUnitsPeer.STUDENTID, getStudentid());
                            collStudentAllowedUnitss = StudentAllowedUnitsPeer.doSelectJoinStudent(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentAllowedUnitsPeer.STUDENTID, getStudentid());
                        if (!lastStudentAllowedUnitssCriteria.equals(criteria))
            {
                collStudentAllowedUnitss = StudentAllowedUnitsPeer.doSelectJoinStudent(criteria);
            }
        }
        lastStudentAllowedUnitssCriteria = criteria;

        return collStudentAllowedUnitss;
    }
                            


                          
            
    /**
     * Collection to store aggregation of collStudentDegrees
     */
    protected List collStudentDegrees;

    /**
     * Temporary storage of collStudentDegrees to save a possible db hit in
     * the event objects are add to the collection, but the
     * complete collection is never requested.
     */
    protected void initStudentDegrees()
    {
        if (collStudentDegrees == null)
        {
            collStudentDegrees = new ArrayList();
        }
    }

    /**
     * Method called to associate a StudentDegree object to this object
     * through the StudentDegree foreign key attribute
     *
     * @param l StudentDegree
     * @throws TorqueException
     */
    public void addStudentDegree(StudentDegree l) throws TorqueException
    {
        getStudentDegrees().add(l);
        l.setStudent((Student) this);
    }

    /**
     * The criteria used to select the current contents of collStudentDegrees
     */
    private Criteria lastStudentDegreesCriteria = null;

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentDegrees(new Criteria())
     *
     * @throws TorqueException
     */
    public List getStudentDegrees() throws TorqueException
    {
        if (collStudentDegrees == null)
        {
            collStudentDegrees = getStudentDegrees(new Criteria(10));
        }
        return collStudentDegrees;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentDegrees from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     *
     * @throws TorqueException
     */
    public List getStudentDegrees(Criteria criteria) throws TorqueException
    {
        if (collStudentDegrees == null)
        {
            if (isNew())
            {
               collStudentDegrees = new ArrayList();
            }
            else
            {
                      criteria.add(StudentDegreePeer.STUDENTID, getStudentid() );
                      collStudentDegrees = StudentDegreePeer.doSelect(criteria);
            }
        }
        else
        {
            // criteria has no effect for a new object
            if (!isNew())
            {
                // the following code is to determine if a new query is
                // called for.  If the criteria is the same as the last
                // one, just return the collection.
                      criteria.add(StudentDegreePeer.STUDENTID, getStudentid());
                      if (!lastStudentDegreesCriteria.equals(criteria))
                {
                    collStudentDegrees = StudentDegreePeer.doSelect(criteria);
                }
            }
        }
        lastStudentDegreesCriteria = criteria;

        return collStudentDegrees;
    }

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentDegrees(new Criteria(),Connection)
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentDegrees(Connection con) throws TorqueException
    {
        if (collStudentDegrees == null)
        {
            collStudentDegrees = getStudentDegrees(new Criteria(10), con);
        }
        return collStudentDegrees;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentDegrees from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentDegrees(Criteria criteria, Connection con)
            throws TorqueException
    {
        if (collStudentDegrees == null)
        {
            if (isNew())
            {
               collStudentDegrees = new ArrayList();
            }
            else
            {
                       criteria.add(StudentDegreePeer.STUDENTID, getStudentid());
                       collStudentDegrees = StudentDegreePeer.doSelect(criteria, con);
             }
         }
         else
         {
             // criteria has no effect for a new object
             if (!isNew())
             {
                 // the following code is to determine if a new query is
                 // called for.  If the criteria is the same as the last
                 // one, just return the collection.
                       criteria.add(StudentDegreePeer.STUDENTID, getStudentid());
                       if (!lastStudentDegreesCriteria.equals(criteria))
                 {
                     collStudentDegrees = StudentDegreePeer.doSelect(criteria, con);
                 }
             }
         }
         lastStudentDegreesCriteria = criteria;

         return collStudentDegrees;
     }

                        
              
                    
                              
                                
                                                              
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentDegrees from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentDegreesJoinStudent(Criteria criteria)
        throws TorqueException
    {
        if (collStudentDegrees == null)
        {
            if (isNew())
            {
               collStudentDegrees = new ArrayList();
            }
            else
            {
                            criteria.add(StudentDegreePeer.STUDENTID, getStudentid());
                            collStudentDegrees = StudentDegreePeer.doSelectJoinStudent(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentDegreePeer.STUDENTID, getStudentid());
                        if (!lastStudentDegreesCriteria.equals(criteria))
            {
                collStudentDegrees = StudentDegreePeer.doSelectJoinStudent(criteria);
            }
        }
        lastStudentDegreesCriteria = criteria;

        return collStudentDegrees;
    }
                  
                    
                    
                                
                                                              
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentDegrees from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentDegreesJoinDegreeCourse(Criteria criteria)
        throws TorqueException
    {
        if (collStudentDegrees == null)
        {
            if (isNew())
            {
               collStudentDegrees = new ArrayList();
            }
            else
            {
                            criteria.add(StudentDegreePeer.STUDENTID, getStudentid());
                            collStudentDegrees = StudentDegreePeer.doSelectJoinDegreeCourse(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentDegreePeer.STUDENTID, getStudentid());
                        if (!lastStudentDegreesCriteria.equals(criteria))
            {
                collStudentDegrees = StudentDegreePeer.doSelectJoinDegreeCourse(criteria);
            }
        }
        lastStudentDegreesCriteria = criteria;

        return collStudentDegrees;
    }
                            


                          
            
    /**
     * Collection to store aggregation of collStudentColleges
     */
    protected List collStudentColleges;

    /**
     * Temporary storage of collStudentColleges to save a possible db hit in
     * the event objects are add to the collection, but the
     * complete collection is never requested.
     */
    protected void initStudentColleges()
    {
        if (collStudentColleges == null)
        {
            collStudentColleges = new ArrayList();
        }
    }

    /**
     * Method called to associate a StudentCollege object to this object
     * through the StudentCollege foreign key attribute
     *
     * @param l StudentCollege
     * @throws TorqueException
     */
    public void addStudentCollege(StudentCollege l) throws TorqueException
    {
        getStudentColleges().add(l);
        l.setStudent((Student) this);
    }

    /**
     * The criteria used to select the current contents of collStudentColleges
     */
    private Criteria lastStudentCollegesCriteria = null;

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentColleges(new Criteria())
     *
     * @throws TorqueException
     */
    public List getStudentColleges() throws TorqueException
    {
        if (collStudentColleges == null)
        {
            collStudentColleges = getStudentColleges(new Criteria(10));
        }
        return collStudentColleges;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentColleges from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     *
     * @throws TorqueException
     */
    public List getStudentColleges(Criteria criteria) throws TorqueException
    {
        if (collStudentColleges == null)
        {
            if (isNew())
            {
               collStudentColleges = new ArrayList();
            }
            else
            {
                      criteria.add(StudentCollegePeer.STUDENTID, getStudentid() );
                      collStudentColleges = StudentCollegePeer.doSelect(criteria);
            }
        }
        else
        {
            // criteria has no effect for a new object
            if (!isNew())
            {
                // the following code is to determine if a new query is
                // called for.  If the criteria is the same as the last
                // one, just return the collection.
                      criteria.add(StudentCollegePeer.STUDENTID, getStudentid());
                      if (!lastStudentCollegesCriteria.equals(criteria))
                {
                    collStudentColleges = StudentCollegePeer.doSelect(criteria);
                }
            }
        }
        lastStudentCollegesCriteria = criteria;

        return collStudentColleges;
    }

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentColleges(new Criteria(),Connection)
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentColleges(Connection con) throws TorqueException
    {
        if (collStudentColleges == null)
        {
            collStudentColleges = getStudentColleges(new Criteria(10), con);
        }
        return collStudentColleges;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentColleges from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentColleges(Criteria criteria, Connection con)
            throws TorqueException
    {
        if (collStudentColleges == null)
        {
            if (isNew())
            {
               collStudentColleges = new ArrayList();
            }
            else
            {
                       criteria.add(StudentCollegePeer.STUDENTID, getStudentid());
                       collStudentColleges = StudentCollegePeer.doSelect(criteria, con);
             }
         }
         else
         {
             // criteria has no effect for a new object
             if (!isNew())
             {
                 // the following code is to determine if a new query is
                 // called for.  If the criteria is the same as the last
                 // one, just return the collection.
                       criteria.add(StudentCollegePeer.STUDENTID, getStudentid());
                       if (!lastStudentCollegesCriteria.equals(criteria))
                 {
                     collStudentColleges = StudentCollegePeer.doSelect(criteria, con);
                 }
             }
         }
         lastStudentCollegesCriteria = criteria;

         return collStudentColleges;
     }

                        
              
                    
                              
                                
                                                              
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentColleges from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentCollegesJoinStudent(Criteria criteria)
        throws TorqueException
    {
        if (collStudentColleges == null)
        {
            if (isNew())
            {
               collStudentColleges = new ArrayList();
            }
            else
            {
                            criteria.add(StudentCollegePeer.STUDENTID, getStudentid());
                            collStudentColleges = StudentCollegePeer.doSelectJoinStudent(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentCollegePeer.STUDENTID, getStudentid());
                        if (!lastStudentCollegesCriteria.equals(criteria))
            {
                collStudentColleges = StudentCollegePeer.doSelectJoinStudent(criteria);
            }
        }
        lastStudentCollegesCriteria = criteria;

        return collStudentColleges;
    }
                  
                    
                    
                                
                                                              
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentColleges from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentCollegesJoinCollege(Criteria criteria)
        throws TorqueException
    {
        if (collStudentColleges == null)
        {
            if (isNew())
            {
               collStudentColleges = new ArrayList();
            }
            else
            {
                            criteria.add(StudentCollegePeer.STUDENTID, getStudentid());
                            collStudentColleges = StudentCollegePeer.doSelectJoinCollege(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentCollegePeer.STUDENTID, getStudentid());
                        if (!lastStudentCollegesCriteria.equals(criteria))
            {
                collStudentColleges = StudentCollegePeer.doSelectJoinCollege(criteria);
            }
        }
        lastStudentCollegesCriteria = criteria;

        return collStudentColleges;
    }
                            


                          
            
    /**
     * Collection to store aggregation of collStudentPhotos
     */
    protected List collStudentPhotos;

    /**
     * Temporary storage of collStudentPhotos to save a possible db hit in
     * the event objects are add to the collection, but the
     * complete collection is never requested.
     */
    protected void initStudentPhotos()
    {
        if (collStudentPhotos == null)
        {
            collStudentPhotos = new ArrayList();
        }
    }

    /**
     * Method called to associate a StudentPhoto object to this object
     * through the StudentPhoto foreign key attribute
     *
     * @param l StudentPhoto
     * @throws TorqueException
     */
    public void addStudentPhoto(StudentPhoto l) throws TorqueException
    {
        getStudentPhotos().add(l);
        l.setStudent((Student) this);
    }

    /**
     * The criteria used to select the current contents of collStudentPhotos
     */
    private Criteria lastStudentPhotosCriteria = null;

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentPhotos(new Criteria())
     *
     * @throws TorqueException
     */
    public List getStudentPhotos() throws TorqueException
    {
        if (collStudentPhotos == null)
        {
            collStudentPhotos = getStudentPhotos(new Criteria(10));
        }
        return collStudentPhotos;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentPhotos from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     *
     * @throws TorqueException
     */
    public List getStudentPhotos(Criteria criteria) throws TorqueException
    {
        if (collStudentPhotos == null)
        {
            if (isNew())
            {
               collStudentPhotos = new ArrayList();
            }
            else
            {
                      criteria.add(StudentPhotoPeer.STUDENTID, getStudentid() );
                      collStudentPhotos = StudentPhotoPeer.doSelect(criteria);
            }
        }
        else
        {
            // criteria has no effect for a new object
            if (!isNew())
            {
                // the following code is to determine if a new query is
                // called for.  If the criteria is the same as the last
                // one, just return the collection.
                      criteria.add(StudentPhotoPeer.STUDENTID, getStudentid());
                      if (!lastStudentPhotosCriteria.equals(criteria))
                {
                    collStudentPhotos = StudentPhotoPeer.doSelect(criteria);
                }
            }
        }
        lastStudentPhotosCriteria = criteria;

        return collStudentPhotos;
    }

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getStudentPhotos(new Criteria(),Connection)
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentPhotos(Connection con) throws TorqueException
    {
        if (collStudentPhotos == null)
        {
            collStudentPhotos = getStudentPhotos(new Criteria(10), con);
        }
        return collStudentPhotos;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related StudentPhotos from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getStudentPhotos(Criteria criteria, Connection con)
            throws TorqueException
    {
        if (collStudentPhotos == null)
        {
            if (isNew())
            {
               collStudentPhotos = new ArrayList();
            }
            else
            {
                       criteria.add(StudentPhotoPeer.STUDENTID, getStudentid());
                       collStudentPhotos = StudentPhotoPeer.doSelect(criteria, con);
             }
         }
         else
         {
             // criteria has no effect for a new object
             if (!isNew())
             {
                 // the following code is to determine if a new query is
                 // called for.  If the criteria is the same as the last
                 // one, just return the collection.
                       criteria.add(StudentPhotoPeer.STUDENTID, getStudentid());
                       if (!lastStudentPhotosCriteria.equals(criteria))
                 {
                     collStudentPhotos = StudentPhotoPeer.doSelect(criteria, con);
                 }
             }
         }
         lastStudentPhotosCriteria = criteria;

         return collStudentPhotos;
     }

                  
              
                    
                              
                                
                                                              
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related StudentPhotos from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getStudentPhotosJoinStudent(Criteria criteria)
        throws TorqueException
    {
        if (collStudentPhotos == null)
        {
            if (isNew())
            {
               collStudentPhotos = new ArrayList();
            }
            else
            {
                            criteria.add(StudentPhotoPeer.STUDENTID, getStudentid());
                            collStudentPhotos = StudentPhotoPeer.doSelectJoinStudent(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(StudentPhotoPeer.STUDENTID, getStudentid());
                        if (!lastStudentPhotosCriteria.equals(criteria))
            {
                collStudentPhotos = StudentPhotoPeer.doSelectJoinStudent(criteria);
            }
        }
        lastStudentPhotosCriteria = criteria;

        return collStudentPhotos;
    }
                            


                          
            
    /**
     * Collection to store aggregation of collGrades
     */
    protected List collGrades;

    /**
     * Temporary storage of collGrades to save a possible db hit in
     * the event objects are add to the collection, but the
     * complete collection is never requested.
     */
    protected void initGrades()
    {
        if (collGrades == null)
        {
            collGrades = new ArrayList();
        }
    }

    /**
     * Method called to associate a Grade object to this object
     * through the Grade foreign key attribute
     *
     * @param l Grade
     * @throws TorqueException
     */
    public void addGrade(Grade l) throws TorqueException
    {
        getGrades().add(l);
        l.setStudent((Student) this);
    }

    /**
     * The criteria used to select the current contents of collGrades
     */
    private Criteria lastGradesCriteria = null;

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getGrades(new Criteria())
     *
     * @throws TorqueException
     */
    public List getGrades() throws TorqueException
    {
        if (collGrades == null)
        {
            collGrades = getGrades(new Criteria(10));
        }
        return collGrades;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related Grades from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     *
     * @throws TorqueException
     */
    public List getGrades(Criteria criteria) throws TorqueException
    {
        if (collGrades == null)
        {
            if (isNew())
            {
               collGrades = new ArrayList();
            }
            else
            {
                      criteria.add(GradePeer.STUDENTID, getStudentid() );
                      collGrades = GradePeer.doSelect(criteria);
            }
        }
        else
        {
            // criteria has no effect for a new object
            if (!isNew())
            {
                // the following code is to determine if a new query is
                // called for.  If the criteria is the same as the last
                // one, just return the collection.
                      criteria.add(GradePeer.STUDENTID, getStudentid());
                      if (!lastGradesCriteria.equals(criteria))
                {
                    collGrades = GradePeer.doSelect(criteria);
                }
            }
        }
        lastGradesCriteria = criteria;

        return collGrades;
    }

    /**
     * If this collection has already been initialized, returns
     * the collection. Otherwise returns the results of
     * getGrades(new Criteria(),Connection)
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getGrades(Connection con) throws TorqueException
    {
        if (collGrades == null)
        {
            collGrades = getGrades(new Criteria(10), con);
        }
        return collGrades;
    }

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student has previously
     * been saved, it will retrieve related Grades from storage.
     * If this Student is new, it will return
     * an empty collection or the current collection, the criteria
     * is ignored on a new object.
     * This method takes in the Connection also as input so that
     * referenced objects can also be obtained using a Connection
     * that is taken as input
     */
    public List getGrades(Criteria criteria, Connection con)
            throws TorqueException
    {
        if (collGrades == null)
        {
            if (isNew())
            {
               collGrades = new ArrayList();
            }
            else
            {
                       criteria.add(GradePeer.STUDENTID, getStudentid());
                       collGrades = GradePeer.doSelect(criteria, con);
             }
         }
         else
         {
             // criteria has no effect for a new object
             if (!isNew())
             {
                 // the following code is to determine if a new query is
                 // called for.  If the criteria is the same as the last
                 // one, just return the collection.
                       criteria.add(GradePeer.STUDENTID, getStudentid());
                       if (!lastGradesCriteria.equals(criteria))
                 {
                     collGrades = GradePeer.doSelect(criteria, con);
                 }
             }
         }
         lastGradesCriteria = criteria;

         return collGrades;
     }

                        
              
                    
                              
                                
                                                              
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related Grades from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getGradesJoinStudent(Criteria criteria)
        throws TorqueException
    {
        if (collGrades == null)
        {
            if (isNew())
            {
               collGrades = new ArrayList();
            }
            else
            {
                            criteria.add(GradePeer.STUDENTID, getStudentid());
                            collGrades = GradePeer.doSelectJoinStudent(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(GradePeer.STUDENTID, getStudentid());
                        if (!lastGradesCriteria.equals(criteria))
            {
                collGrades = GradePeer.doSelectJoinStudent(criteria);
            }
        }
        lastGradesCriteria = criteria;

        return collGrades;
    }
                  
                    
                    
                                
                                                              
                                        
                    
                    
          
    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this Student is new, it will return
     * an empty collection; or if this Student has previously
     * been saved, it will retrieve related Grades from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in Student.
     */
    protected List getGradesJoinCourse(Criteria criteria)
        throws TorqueException
    {
        if (collGrades == null)
        {
            if (isNew())
            {
               collGrades = new ArrayList();
            }
            else
            {
                            criteria.add(GradePeer.STUDENTID, getStudentid());
                            collGrades = GradePeer.doSelectJoinCourse(criteria);
            }
        }
        else
        {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
            boolean newCriteria = true;
                        criteria.add(GradePeer.STUDENTID, getStudentid());
                        if (!lastGradesCriteria.equals(criteria))
            {
                collGrades = GradePeer.doSelectJoinCourse(criteria);
            }
        }
        lastGradesCriteria = criteria;

        return collGrades;
    }
                            


          
    private static List fieldNames = null;

    /**
     * Generate a list of field names.
     *
     * @return a list of field names
     */
    public static synchronized List getFieldNames()
    {
        if (fieldNames == null)
        {
            fieldNames = new ArrayList();
              fieldNames.add("Studentid");
              fieldNames.add("Studentnumber");
              fieldNames.add("Firstname");
              fieldNames.add("Middlename");
              fieldNames.add("Lastname");
              fieldNames = Collections.unmodifiableList(fieldNames);
        }
        return fieldNames;
    }

    /**
     * Retrieves a field from the object by name passed in as a String.
     *
     * @param name field name
     * @return value
     */
    public Object getByName(String name)
    {
          if (name.equals("Studentid"))
        {
                return new Integer(getStudentid());
            }
          if (name.equals("Studentnumber"))
        {
                return getStudentnumber();
            }
          if (name.equals("Firstname"))
        {
                return getFirstname();
            }
          if (name.equals("Middlename"))
        {
                return getMiddlename();
            }
          if (name.equals("Lastname"))
        {
                return getLastname();
            }
          return null;
    }
    
    /**
     * Retrieves a field from the object by name passed in
     * as a String.  The String must be one of the static
     * Strings defined in this Class' Peer.
     *
     * @param name peer name
     * @return value
     */
    public Object getByPeerName(String name)
    {
          if (name.equals(StudentPeer.STUDENTID))
        {
                return new Integer(getStudentid());
            }
          if (name.equals(StudentPeer.STUDENTNUMBER))
        {
                return getStudentnumber();
            }
          if (name.equals(StudentPeer.FIRSTNAME))
        {
                return getFirstname();
            }
          if (name.equals(StudentPeer.MIDDLENAME))
        {
                return getMiddlename();
            }
          if (name.equals(StudentPeer.LASTNAME))
        {
                return getLastname();
            }
          return null;
    }

    /**
     * Retrieves a field from the object by Position as specified
     * in the xml schema.  Zero-based.
     *
     * @param pos position in xml schema
     * @return value
     */
    public Object getByPosition(int pos)
    {
            if (pos == 0)
        {
                return new Integer(getStudentid());
            }
              if (pos == 1)
        {
                return getStudentnumber();
            }
              if (pos == 2)
        {
                return getFirstname();
            }
              if (pos == 3)
        {
                return getMiddlename();
            }
              if (pos == 4)
        {
                return getLastname();
            }
              return null;
    }
     
    /**
     * Stores the object in the database.  If the object is new,
     * it inserts it; otherwise an update is performed.
     *
     * @throws Exception
     */
    public void save() throws Exception
    {
          save(StudentPeer.getMapBuilder()
                .getDatabaseMap().getName());
      }

    /**
     * Stores the object in the database.  If the object is new,
     * it inserts it; otherwise an update is performed.
       * Note: this code is here because the method body is
     * auto-generated conditionally and therefore needs to be
     * in this file instead of in the super class, BaseObject.
       *
     * @param dbName
     * @throws TorqueException
     */
    public void save(String dbName) throws TorqueException
    {
        Connection con = null;
          try
        {
            con = Transaction.begin(dbName);
            save(con);
            Transaction.commit(con);
        }
        catch(TorqueException e)
        {
            Transaction.safeRollback(con);
            throw e;
        }
      }

      /** flag to prevent endless save loop, if this object is referenced
        by another object which falls in this transaction. */
    private boolean alreadyInSave = false;
      /**
     * Stores the object in the database.  If the object is new,
     * it inserts it; otherwise an update is performed.  This method
     * is meant to be used as part of a transaction, otherwise use
     * the save() method and the connection details will be handled
     * internally
     *
     * @param con
     * @throws TorqueException
     */
    public void save(Connection con) throws TorqueException
    {
          if (!alreadyInSave)
        {
            alreadyInSave = true;


  
            // If this object has been modified, then save it to the database.
            if (isModified())
            {
                if (isNew())
                {
                    StudentPeer.doInsert((Student) this, con);
                    setNew(false);
                }
                else
                {
                    StudentPeer.doUpdate((Student) this, con);
                }
            }

                                      
                
            if (collStudentPersonalInformations != null)
            {
                for (int i = 0; i < collStudentPersonalInformations.size(); i++)
                {
                    ((StudentPersonalInformation) collStudentPersonalInformations.get(i)).save(con);
                }
            }
                                          
                
            if (collStudentStfaps != null)
            {
                for (int i = 0; i < collStudentStfaps.size(); i++)
                {
                    ((StudentStfap) collStudentStfaps.get(i)).save(con);
                }
            }
                                          
                
            if (collStudentSignatures != null)
            {
                for (int i = 0; i < collStudentSignatures.size(); i++)
                {
                    ((StudentSignature) collStudentSignatures.get(i)).save(con);
                }
            }
                                          
                
            if (collStudentRgeps != null)
            {
                for (int i = 0; i < collStudentRgeps.size(); i++)
                {
                    ((StudentRgep) collStudentRgeps.get(i)).save(con);
                }
            }
                                          
                
            if (collStudentOverloads != null)
            {
                for (int i = 0; i < collStudentOverloads.size(); i++)
                {
                    ((StudentOverload) collStudentOverloads.get(i)).save(con);
                }
            }
                                          
                
            if (collStudentPreviousStatuss != null)
            {
                for (int i = 0; i < collStudentPreviousStatuss.size(); i++)
                {
                    ((StudentPreviousStatus) collStudentPreviousStatuss.get(i)).save(con);
                }
            }
                                          
                
            if (collStudentAdvisers != null)
            {
                for (int i = 0; i < collStudentAdvisers.size(); i++)
                {
                    ((StudentAdviser) collStudentAdvisers.get(i)).save(con);
                }
            }
                                          
                
            if (collStudentClassifications != null)
            {
                for (int i = 0; i < collStudentClassifications.size(); i++)
                {
                    ((StudentClassification) collStudentClassifications.get(i)).save(con);
                }
            }
                                          
                
            if (collStudentCurriculums != null)
            {
                for (int i = 0; i < collStudentCurriculums.size(); i++)
                {
                    ((StudentCurriculum) collStudentCurriculums.get(i)).save(con);
                }
            }
                                          
                
            if (collStudentAllowedUnitss != null)
            {
                for (int i = 0; i < collStudentAllowedUnitss.size(); i++)
                {
                    ((StudentAllowedUnits) collStudentAllowedUnitss.get(i)).save(con);
                }
            }
                                          
                
            if (collStudentDegrees != null)
            {
                for (int i = 0; i < collStudentDegrees.size(); i++)
                {
                    ((StudentDegree) collStudentDegrees.get(i)).save(con);
                }
            }
                                          
                
            if (collStudentColleges != null)
            {
                for (int i = 0; i < collStudentColleges.size(); i++)
                {
                    ((StudentCollege) collStudentColleges.get(i)).save(con);
                }
            }
                                          
                
            if (collStudentPhotos != null)
            {
                for (int i = 0; i < collStudentPhotos.size(); i++)
                {
                    ((StudentPhoto) collStudentPhotos.get(i)).save(con);
                }
            }
                                          
                
            if (collGrades != null)
            {
                for (int i = 0; i < collGrades.size(); i++)
                {
                    ((Grade) collGrades.get(i)).save(con);
                }
            }
                          alreadyInSave = false;
        }
      }


                          
      /**
     * Set the PrimaryKey using ObjectKey.
     *
     * @param  studentid ObjectKey
     */
    public void setPrimaryKey(ObjectKey key)
        throws TorqueException
    {
            setStudentid(((NumberKey) key).intValue());
        }

    /**
     * Set the PrimaryKey using a String.
     *
     * @param key
     */
    public void setPrimaryKey(String key) throws TorqueException
    {
            setStudentid(Integer.parseInt(key));
        }

  
    /**
     * returns an id that differentiates this object from others
     * of its class.
     */
    public ObjectKey getPrimaryKey()
    {
          return SimpleKey.keyFor(getStudentid());
      }

 

    /**
     * Makes a copy of this object.
     * It creates a new object filling in the simple attributes.
       * It then fills all the association collections and sets the
     * related objects to isNew=true.
       */
      public Student copy() throws TorqueException
    {
        return copyInto(new Student());
    }
  
    protected Student copyInto(Student copyObj) throws TorqueException
    {
          copyObj.setStudentid(studentid);
          copyObj.setStudentnumber(studentnumber);
          copyObj.setFirstname(firstname);
          copyObj.setMiddlename(middlename);
          copyObj.setLastname(lastname);
  
                    copyObj.setStudentid(0);
                                    
                                      
                
        List v = getStudentPersonalInformations();
        for (int i = 0; i < v.size(); i++)
        {
            StudentPersonalInformation obj = (StudentPersonalInformation) v.get(i);
            copyObj.addStudentPersonalInformation(obj.copy());
        }
                                                  
                
        v = getStudentStfaps();
        for (int i = 0; i < v.size(); i++)
        {
            StudentStfap obj = (StudentStfap) v.get(i);
            copyObj.addStudentStfap(obj.copy());
        }
                                                  
                
        v = getStudentSignatures();
        for (int i = 0; i < v.size(); i++)
        {
            StudentSignature obj = (StudentSignature) v.get(i);
            copyObj.addStudentSignature(obj.copy());
        }
                                                  
                
        v = getStudentRgeps();
        for (int i = 0; i < v.size(); i++)
        {
            StudentRgep obj = (StudentRgep) v.get(i);
            copyObj.addStudentRgep(obj.copy());
        }
                                                  
                
        v = getStudentOverloads();
        for (int i = 0; i < v.size(); i++)
        {
            StudentOverload obj = (StudentOverload) v.get(i);
            copyObj.addStudentOverload(obj.copy());
        }
                                                  
                
        v = getStudentPreviousStatuss();
        for (int i = 0; i < v.size(); i++)
        {
            StudentPreviousStatus obj = (StudentPreviousStatus) v.get(i);
            copyObj.addStudentPreviousStatus(obj.copy());
        }
                                                  
                
        v = getStudentAdvisers();
        for (int i = 0; i < v.size(); i++)
        {
            StudentAdviser obj = (StudentAdviser) v.get(i);
            copyObj.addStudentAdviser(obj.copy());
        }
                                                  
                
        v = getStudentClassifications();
        for (int i = 0; i < v.size(); i++)
        {
            StudentClassification obj = (StudentClassification) v.get(i);
            copyObj.addStudentClassification(obj.copy());
        }
                                                  
                
        v = getStudentCurriculums();
        for (int i = 0; i < v.size(); i++)
        {
            StudentCurriculum obj = (StudentCurriculum) v.get(i);
            copyObj.addStudentCurriculum(obj.copy());
        }
                                                  
                
        v = getStudentAllowedUnitss();
        for (int i = 0; i < v.size(); i++)
        {
            StudentAllowedUnits obj = (StudentAllowedUnits) v.get(i);
            copyObj.addStudentAllowedUnits(obj.copy());
        }
                                                  
                
        v = getStudentDegrees();
        for (int i = 0; i < v.size(); i++)
        {
            StudentDegree obj = (StudentDegree) v.get(i);
            copyObj.addStudentDegree(obj.copy());
        }
                                                  
                
        v = getStudentColleges();
        for (int i = 0; i < v.size(); i++)
        {
            StudentCollege obj = (StudentCollege) v.get(i);
            copyObj.addStudentCollege(obj.copy());
        }
                                                  
                
        v = getStudentPhotos();
        for (int i = 0; i < v.size(); i++)
        {
            StudentPhoto obj = (StudentPhoto) v.get(i);
            copyObj.addStudentPhoto(obj.copy());
        }
                                                  
                
        v = getGrades();
        for (int i = 0; i < v.size(); i++)
        {
            Grade obj = (Grade) v.get(i);
            copyObj.addGrade(obj.copy());
        }
                    
        return copyObj;
    }

    /**
     * returns a peer instance associated with this om.  Since Peer classes
     * are not to have any instance attributes, this method returns the
     * same instance for all member of this class. The method could therefore
     * be static, but this would prevent one from overriding the behavior.
     */
    public StudentPeer getPeer()
    {
        return peer;
    }

    public String toString()
    {
        StringBuffer str = new StringBuffer();
        str.append("Student:\n");
        str.append("Studentid = ")
           .append(getStudentid())
           .append("\n");
        str.append("Studentnumber = ")
           .append(getStudentnumber())
           .append("\n");
        str.append("Firstname = ")
           .append(getFirstname())
           .append("\n");
        str.append("Middlename = ")
           .append(getMiddlename())
           .append("\n");
        str.append("Lastname = ")
           .append(getLastname())
           .append("\n");
        return(str.toString());
    }
}
